package com.ods.df

import android.content.pm.PackageManager
import android.content.pm.PackageManager.NameNotFoundException
import android.os.Bundle
import android.util.Log
import io.flutter.embedding.android.FlutterActivity


class MainActivity: FlutterActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        getActivityLabel()
    }

    private fun getActivityLabel(): String? {
        try {
            val metaData: Bundle = getPackageManager().getActivityInfo(
                getComponentName(),
                PackageManager.GET_META_DATA
            ).metaData

            val data: String? = metaData.getString("activity_label")
            Log.w("【浩汉】", "AndroidManifest包名= $data")
            return data
        } catch (e: NameNotFoundException) {
            e.printStackTrace()
            return null
        }
    }

}
